package greetings

/**
用切片模拟一个栈
*/
func StackStringAppend(s *[]string, v string) {
	*s = append(*s, v)
}

func StackStringPeek(s *[]string) string {
	return (*s)[len(*s)-1]
}

func StackStringPop(s *[]string) string {

	res := (*s)[len((*s))-1]
	*s = (*s)[:len((*s))-1]
	return res
}

func StackStringRemove(slice *[]string, i int) *[]string {
	copy((*slice)[i:], (*slice)[i+1:])
	res := ((*slice)[:len((*slice))-1])
	return &res
}
